//FindChangeList.txt

//Esse é um arquivo de suporte para o script FindChangeByList.jsx
//Aqui é possível executar rotinas sequenciais de FIND-CHANGE
//Funciona para substituições do tipo "text", "grep" e "glyph"

//Metacaracteres precisarão ter a barra invertida duplicada
//Na interface, para buscar 'qualquer dígito' em grep o metacaractere é "\d"
//Aqui deverá ser "\\d"

//As informações precisam ser separadas por <tab>

//Templates
//----
//grep	{findWhat:""}	{changeTo:""}	{includeFootnotes:true, includeMasterPages:false, includeHiddenLayers:false, wholeWord:false}
//text	{findWhat:""}	{changeTo:""}	{includeFootnotes:true, includeMasterPages:false, includeHiddenLayers:false, wholeWord:false}
//----
//grep	{findWhat:"", appliedParagraphStyle: ""}	{changeTo:"", appliedParagraphStyle: ""}	{includeFootnotes:true, includeMasterPages:false, includeHiddenLayers:false, wholeWord:false}
//text	{findWhat:"", appliedParagraphStyle: ""}	{changeTo:"", appliedParagraphStyle: ""}	{includeFootnotes:true, includeMasterPages:false, includeHiddenLayers:false, wholeWord:false}


//----------------------------//
//Exemplo de rotina de limpeza//
//----------------------------//

//Remover espaços brancos após e antes do final do parágrafo
grep	{findWhat:"$ +", appliedParagraphStyle: ""}	{changeTo:"", appliedParagraphStyle: ""}	{includeFootnotes:true, includeMasterPages:false, includeHiddenLayers:false, wholeWord:false}
grep	{findWhat:" +$", appliedParagraphStyle: ""}	{changeTo:"", appliedParagraphStyle: ""}	{includeFootnotes:true, includeMasterPages:false, includeHiddenLayers:false, wholeWord:false}

//Procurar 2 ou mais espaços brancos e substituir por 1
grep	{findWhat:"  +"}	{changeTo:" "}	{includeFootnotes:true, includeMasterPages:true, includeHiddenLayers:true, wholeWord:false}

//Procurar 2 ou mais tabs e substituir por 1
grep	{findWhat:"\\t\\t+"}	{changeTo:"\\t"}	{includeFootnotes:true, includeMasterPages:true, includeHiddenLayers:false, wholeWord:false}

//Remover tab após e antes do final do parágrafo
grep	{findWhat:"$\\t", appliedParagraphStyle: ""}	{changeTo:"", appliedParagraphStyle: ""}	{includeFootnotes:true, includeMasterPages:false, includeHiddenLayers:false, wholeWord:false}
grep	{findWhat:"\\t$", appliedParagraphStyle: ""}	{changeTo:"", appliedParagraphStyle: ""}	{includeFootnotes:true, includeMasterPages:false, includeHiddenLayers:false, wholeWord:false}

//Procurar espaço-hífen-espaço e substituir hífen por en-dash
grep	{findWhat:" - ", appliedParagraphStyle: ""}	{changeTo:" ~= ", appliedParagraphStyle: ""}	{includeFootnotes:true, includeMasterPages:false, includeHiddenLayers:false, wholeWord:false}

//Remover espaço antes de pontuação de final de parágrafo
grep	{findWhat:"( +)([[:punct:]]$)", appliedParagraphStyle: ""}	{changeTo:"$2", appliedParagraphStyle: ""}	{includeFootnotes:true, includeMasterPages:false, includeHiddenLayers:false, wholeWord:false}

//Remover espaço no começo do parágrafo
grep	{findWhat:"^ +", appliedParagraphStyle: ""}	{changeTo:"", appliedParagraphStyle: ""}	{includeFootnotes:true, includeMasterPages:false, includeHiddenLayers:false, wholeWord:false}

//Procurar 2 ou mais enters e substituir por 1
grep	{findWhat:"\\r\\r+"}	{changeTo:"\\r"}	{includeFootnotes:true, includeMasterPages:true, includeHiddenLayers:false, wholeWord:false}